﻿@model IEnumerable<string>
@{
    Layout = null;
}
<ul id="memberselectul" style="">
    @foreach (var x in Model)
    {
        <li>
            <input type="checkbox" class="searchProject" value="@x" />@x
        </li>
        
    }
</ul>
@*<p style="margin-top: 20px; text-align: right;">
    <button onclick="okproject()" class="t-button">
        确定</button>
    <button onclick="closeproject()" class="t-button">
        取消</button>
</p>*@
<style>
    #memberselectul
    {
        overflow: auto;
        padding: 0;
        text-decoration: none;
        list-style: none;
    }
    #memberselectul li
    {
        width: 200px;
        float: left;
        margin: 5px;
        list-style: none;
    }
</style>
<script>
    function closeproject() {
        
        getMember();
        var window = $("#GetProjects").data("tWindow");
        window.close();
        
    }
    function getMember() {
        var selec = $("#searchProject").val();
        var url = "/TimeLine/GetSelectedProjectMember/";
        $("#searchValue").find("option").remove();
        $("<option></option>").val("00").text("所有人员").appendTo($("#searchValue"));
        $.getJSON(url, { 'name': selec }, function (data) {
            $.each(data, function (i, item) {
                $("<option></option>").val(item["Value"]).text(item["Text"]).appendTo($("#searchValue"));
            });
        });

    }



    function okproject() {
        var checks = "";
        $("input[name='cbproject']").each(function () {
            if (this.checked) {
                checks += $(this).val() + ";";
            }
        });
        $("#searchProject").val(checks);
        closeproject();
    }

</script>
